<template>
  <div class="classify-container">
    <div class="text">请根据需要考核的指标内容，点击添加对应的考核类型</div>
    <div class="list">
      <div v-for="(item,key) in list" :key="key" :class="{'item':true,'item-no-choose': !item.show}" @click="handleChooseItem(item)">
        <div class="pic">
          <el-image
            style="width: 100px; height: 100px"
            :src="item.show ? item.icon1 : item.icon"
            :fit="fit"
          />
        </div>
        <div class="name" :style="{color:item.show ? '#ccc' : '#000'}">{{ item.name }}</div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'FormManagerClassify',
  props: {
    list: {
      type: Array,
      default: () => { return [] }
    }
  },
  data() {
    return {
      fit: 'cover'
    }
  },
  methods: {
    handleChooseItem(item) {
      console.log('嗯啊item', item)
      if (!item.show) {
        this.$emit('choose', item.key)
      }
    }
  }
}
</script>
<style lang="scss" scoped>
.classify-container{
    .text{
        width: 100%;
        text-align: center;
        margin-bottom:20px;
    }
    .list{
        display:flex;
        align-items: center;
        justify-content: center;
        .item{
            width:150px;
            text-align:center;

        }
        .item-no-choose:hover{
          cursor: pointer;
        }
    }
}
</style>

